Ext.define("App.model.Bill", {
    extend: "Ext.data.Model",
    config: {
        fields: [{
            name: "OfficeID",
            type: "int"
        }, {
            name: "Type",
            type: "string"
        }, {
            name: "Memo",
            type: "string"
        }, {
            name: "Memo1",
            type: "string"
        }, {
            name: "Memo2",
            type: "string"
        }, {
            name: "Memo3",
            type: "string"
        }],
        belongsTo: "Legislator"
    }
});
Ext.define("App.model.Disease", {
    extend: "Ext.data.Model",
    config: {
        fields: [{
            name: "sicknessid",
            type: "string"
        }, {
            name: "sickness",
            type: "string"
        }, {
            name: "memo",
            type: "string"
        }, {
            name: "detail",
            type: "string"
        }]
    }
});
Ext.define("App.model.Home", {
    extend: "Ext.data.Model",
    config: {
        fields: [{
            name: "menu",
            type: "string"
        }, {
            name: "images",
            type: "string"
        }]
    }
});
Ext.define("App.model.Info", {
    extend: "Ext.data.Model",
    config: {
        fields: ["id", "name", "description", "items"]
    }
});
Ext.define("App.model.Legislator", {
    extend: "Ext.data.Model",
    config: {
        fields: [{
            name: "ID",
            type: "int"
        }, {
            name: "OfficeID",
            type: "int"
        }, {
            name: "DoctorsID",
            type: "int"
        }, {
            name: "Hosname",
            type: "string"
        }, {
            name: "Address",
            type: "string"
        }, {
            name: "Postcode",
            type: "string"
        }, {
            name: "Tel",
            type: "string"
        }, {
            name: "Rank",
            type: "string"
        }, {
            name: "State",
            type: "string"
        }, {
            name: "Abbr",
            type: "string"
        }, {
            name: "Title",
            type: "string"
        }, {
            name: "Memo1",
            type: "object"
        }, {
            name: "Memo2",
            type: "string"
        }, {
            name: "Memo3",
            type: "string"
        }],
        hasMany: "Bill"
    }
});
Ext.define("App.model.More", {
    extend: "Ext.data.Model",
    config: {
        fields: [{
            name: "name"
        }, {
            name: "icon"
        }, {
            name: "needsIcon"
        }]
    }
});
Ext.define("App.model.Sections", {
    extend: "Ext.data.Model",
    config: {
        fields: ["id", "name", "description", "items"]
    }
});
Ext.define("App.model.States", {
    extend: "Ext.data.Model",
    config: {
        fields: "state,abbr,maxDistrict,items,hosname,address".split(",")
    }
});
Ext.define("App.model.States", {
    extend: "Ext.data.Model",
    config: {
        fields: "state,abbr,maxDistrict,items,hosname,address".split(",")
    }
});
Ext.define("App.model.Vote", {
    extend: "Ext.data.Model",
    config: {
        fields: [{
            name: "DoctorID",
            type: "int"
        }, {
            name: "Doctor",
            type: "string"
        }, {
            name: "Domemo",
            type: "string"
        }, {
            name: "Domemo1",
            type: "string"
        }, {
            name: "Domemo2",
            type: "string"
        }]
    }
});
Ext.define("App.store.Bills", {
    extend: "Ext.data.Store",
    config: {
        model: "App.model.Bill",
        groupField: "state",
        proxy: {
            type: "ajax",
            url: "data/hongkou.json",
            noCache: !1,
            startParam: "",
            pageParam: "",
            limitParam: "",
            reader: {
                type: "json",
                rootProperty: "response.bills",
                record: "bill"
            }
        }
    }
});
Ext.define("App.store.Diseases", {
    extend: "Ext.data.Store",
    requires: ["App.model.Disease"],
    config: {
        autoLoad: !0,
        sorters: "memo",
        model: "App.model.Disease",
        groupField: "memo",
        proxy: {
            type: "ajax",
            url: "resources/data/disease.json",
            reader: {
                type: "json",
                rootProperty: "items"
            }
        }
    }
});
Ext.define("App.store.Homes", {
    extend: "Ext.data.Store",
    requires: ["App.model.Home"],
    config: {
        autoLoad: !0,
        model: "App.model.Home",
        proxy: {
            type: "ajax",
            url: "resources/data/home.json",
            reader: {
                type: "json",
                rootProperty: "items"
            }
        }
    }
});
Ext.define("App.store.Infos", {
    extend: "Ext.data.TreeStore",
    requires: ["App.model.Info"],
    config: {
        autoLoad: !0,
        model: "App.model.Info",
        proxy: {
            type: "ajax",
            url: "resources/data/info.json",
            reader: {
                type: "json",
                rootProperty: "items"
            }
        }
    }
});
Ext.define("App.store.Legislators", {
    extend: "Ext.data.Store",
    config: {
        model: "App.model.Legislator",
        groupField: "State",
        proxy: {
            autoload: !1,
            type: "ajax",
            url: "data/shanghai.json",
            reader: {
                type: "json",
                rootProperty: "response.hospitals",
                record: "hospital"
            }
        }
    }
});
Ext.define("App.store.Mores", {
    extend: "Ext.data.Store",
    requires: ["App.model.More"],
    config: {
        autoLoad: !0,
        model: "App.model.More",
        proxy: {
            type: "ajax",
            url: "resources/data/more.json",
            reader: {
                type: "json",
                rootProperty: "items"
            }
        }
    }
});
Ext.define("App.store.Sections", {
    extend: "Ext.data.TreeStore",
    requires: ["App.model.Sections"],
    config: {
        autoLoad: !0,
        model: "App.model.Sections",
        proxy: {
            type: "ajax",
            url: "resources/data/data.json",
            reader: {
                type: "json",
                rootProperty: "items"
            }
        }
    }
});
Ext.define("App.store.States", {
    extend: "Ext.data.Store",
    requires: ["App.model.States"],
    config: {
        autoLoad: !0,
        sorters: "state",
        model: "App.model.States",
        groupField: "maxDistrict",
        proxy: {
            type: "ajax",
            url: "resources/data/province.json",
            reader: {
                type: "json",
                rootProperty: "items"
            }
        }
    }
});
Ext.define("App.store.Votes", {
    extend: "Ext.data.Store",
    config: {
        model: "App.model.Vote",
        groupField: "state",
        proxy: {
            type: "ajax",
            url: "data/baoshan.json",
            noCache: !1,
            startParam: "",
            pageParam: "",
            limitParam: "",
            reader: {
                type: "json",
                rootProperty: "response.votes",
                record: "vote"
            }
        }
    }
});
var tpl = new Ext.XTemplate('<div class="bill">', '<tpl for="office">', "<p>{type}</p>", "</tpl>", "</div>");
Ext.define("App.view.bill.List", {
    extend: "Ext.dataview.List",
    id: "billList",
    config: {
        store: "Bills",
        itemTpl: ['<div class="legislator-list-item">', '<span class="legislator-pic" style="background-image: url(resources/img/5.png);"></span>', "{Type}", "</div>"]
    }
});
Ext.define("App.view.bill.Show", {
    extend: "Ext.Container",
    id: "billSummary",
    config: {
        scrollable: "vertical",
        items: [{
            id: "billSummaryToolbar",
            docked: "top",
            xtype: "toolbar",
            items: [{
                xtype: "button",
                text: "\u8fd4\u56de",
                ui: "back",
                id: "billSummaryBackButton"
            }]
        }],
        tpl: ["{Memo}"]
    }
});
Ext.define("App.view.Hoslist.Bio", {
    extend: "Ext.Container",
    id: "HoslistBio",
    config: {
        tpl: Ext.create("Ext.XTemplate", '<span class="legislator-pic" style="background-image: url(resources/img/ehbo_kit.png);"></span>', '<div class="legislator-name">', '<div class="title">{hosname}</div>', '<div class="district">{state}</div>', "</div>", '<div class="x-list-normal"><div class="x-list-header">\u8054\u7cfb\u65b9\u5f0f</div>', '<div class="legislator-info">', "\u533b\u9662\u5730\u5740: {Address}<br />", "\u90ae\u7f16: {Postcode}<br />", "\u7535\u8bdd: {Tel}", "</div></div>", '<div class="x-list-normal"><div class="x-list-header">\u600e\u4e48\u8d70</div>', '<div class="legislator-info">{Title}</div>', "</div>")
    }
});
Ext.define("App.view.Hoslist.detail", {
    extend: "Ext.dataview.List",
    requires: ["Ext.dataview.List"],
    id: "HosDetail",
    xtype: "HosDetail",
    plugins: [{
        xclass: "Ext.plugin.PullRefresh",
        pullRefreshText: "\u4e0b\u8f7d\u66f4\u591a"
    }, {
        xclass: "Ext.plugin.ListPaging",
        autoPaging: !0
    }],
    config: {
        store: "Legislators",
        loadingText: "\u6570\u636e\u52a0\u8f7d\u4e2d",
        grouped: !0,
        disclosure: !0,
        emptyText: "\u8bf7\u5148\u786e\u4fdd\u662f\u5426\u6709\u7f51\u7edc\uff0c\u518d\u5237\u65b0",
        itemTpl: '<div class="legislator-list-item"><span class="legislator-pic" style="background-image: url(resources/img/3.png);"></span><div class="legislator-name"><div class="title">{Hosname}</div><div class="district">{Rank}</div></div></div>'
    }
});
Ext.define("App.view.Hoslist.List", {
    extend: "Ext.dataview.List",
    requires: ["Ext.dataview.List"],
    id: "HosList",
    xtype: "HosList",
    config: {
        store: "States",
        grouped: !0,
        onItemDisclosure: !0,
        emptyText: "\u8bf7\u5148\u786e\u4fdd\u662f\u5426\u6709\u7f51\u7edc\uff0c\u518d\u5237\u65b0",
        itemTpl: '<span class="legislator-pic" style="background-image: url(resources/img/3.png);"></span><div class="title">{state}</div>'
    }
});
Ext.define("App.view.legislator.Bio", {
    extend: "Ext.Container",
    id: "legislatorBio",
    config: {
        tpl: Ext.create("Ext.XTemplate", '<span class="legislator-pic" style="background-image: url(resources/img/ehbo_kit.png);"></span>', '<div class="legislator-name">', '<div class="title">{Hosname}</div>', '<div class="district">{State}</div>', "</div>", '<div class="x-list-normal"><div class="x-list-header">\u8054\u7cfb\u65b9\u5f0f</div>', '<div class="legislator-info">', "\u533b\u9662\u5730\u5740: {Address}<br />", "\u90ae\u7f16: {Postcode}<br />", "\u7535\u8bdd: {Tel}", "</div></div>", '<div class="x-list-normal"><div class="x-list-header">\u600e\u4e48\u8d70</div>', '<div class="legislator-info">{Title}</div>', "</div>")
    }
});
Ext.define("App.view.search.SearchDetail", {
    extend: "Ext.Container",
    id: "SearchDetail",
    xtype: "SearchDetail",
    config: {
        tpl: Ext.create("Ext.XTemplate", "<div>{detail}</div>")
    }
});
Ext.define("App.view.search.SearchList", {
    extend: "Ext.dataview.List",
    requires: ["Ext.dataview.List"],
    id: "searchList",
    xtype: "searchList",
    config: {
        store: "Diseases",
        grouped: !0,
        onItemDisclosure: !0,
        emptyText: "\u975e\u5e38\u62b1\u6b49\uff0c\u6682\u65e0\u6570\u636e",
        itemTpl: '<span class="legislator-pic" style="background-image: url(resources/img/icon_dot.png);"></span><div class="title">{sickness}</div>'
    }
});
Ext.define("App.view.vote.List", {
    extend: "Ext.dataview.List",
    id: "voteList",
    config: {
        store: "Votes",
        grouped: !0,
        itemCls: "speaker",
        itemTpl: ['<div class="avatar" style="background-image: url(resources/img/dokter.png);"></div>', "<h3>{Doctor}</h3>", "<h4>{Domemo}</h4>", "</div>"]
    }
});
Ext.define("App.view.Detail", {
    extend: "Ext.Panel",
    xtype: "detailcard",
    id: "detailcard",
    config: {
        scrollable: !0,
        defaults: {
            styleHtmlContent: !0
        },
        items: [{
            id: "description",
            html: ""
        }, {
            id: "productBtn",
            xtype: "button",
            ui: "confirm",
            margin: 10,
            text: ""
        }]
    }
});
Ext.define("App.view.HomeCard", {
    extend: "Ext.Panel",
    alias: "widget.homeCard",
    id: "homecard",
    fullscreen: !0,
    config: {
        scrollable: !1,
        layout: {
            type: "vbox"
        },
        items: [{
            xtype: "titlebar",
            id: "splashimg",
            docked: "top"
        }, {
            xtype: "panel",
            margin: "10 0 0 10",
            defaults: {
                xtype: "panel",
                layout: "hbox",
                margin: "40 0 0 2"
            },
            items: [{
                defaults: {
                    xtype: "panel",
                    margin: 13,
                    style: "border: 0px solid #cccccc"
                },
                items: [{
                    html: '<img src="resources/img/ques2.png" width="72" height="72" />',
                    listeners: {
                        tap: {
                            element: "element",
                            fn: function(){
                                Ext.getCmp("mainview").setActiveItem(1)
                            }
                        }
                    }
                }, {
                    html: '<img src="resources/img/disease2.png" width="72" height="72" />',
                    listeners: {
                        tap: {
                            element: "element",
                            fn: function(){
                                Ext.getCmp("mainview").setActiveItem(1)
                            }
                        }
                    }
                }, {
                    html: '<img src="resources/img/search2.png" width="72" height="72" />',
                    listeners: {
                        tap: {
                            element: "element",
                            fn: function(){
                                Ext.getCmp("mainview").setActiveItem(2)
                            }
                        }
                    }
                }]
            }, {
                defaults: {
                    xtype: "panel",
                    margin: 13,
                    style: "border: 0px solid #cccccc"
                },
                items: [{
                    xtype: "panel",
                    margin: 13,
                    html: '<img src="resources/img/mail2.png" width="72" height="72"  />',
                    listeners: {
                        tap: {
                            element: "element",
                            fn: function(){
                                Ext.getCmp("mainview").setActiveItem(4)
                            }
                        }
                    }
                }, {
                    xtype: "panel",
                    margin: 13,
                    html: '<img src="resources/img/gg2.png" width="72" height="72"  />',
                    listeners: {
                        tap: {
                            element: "element",
                            fn: function(){
                                Ext.getCmp("mainview").setActiveItem(4)
                            }
                        }
                    }
                }, {
                    xtype: "panel",
                    margin: 13,
                    html: '<img src="resources/img/setting2.png" width="72" height="72" onclick="act6()" />',
                    listeners: {
                        tap: {
                            element: "element",
                            fn: function(){
                                Ext.getCmp("mainview").setActiveItem(3)
                            }
                        }
                    }
                }]
            }]
        }]
    }
});
Ext.define("App.view.Homepage", {
    extend: "Ext.DataView",
    xtype: "homepage",
    alias: "widget.homepage",
    config: {
        defaults: {
            styleHtmlContent: !1,
            scrollable: !1
        },
        items: [{
            xtype: "titlebar",
            id: "splashimg",
            docked: "top"
        }],
        itemTpl: ["{images}{menu}"]
    },
    initialize: function(){
        this.setStore(Ext.create("Ext.data.Store", {
            requires: "App.model.Home",
            model: "App.model.Home",
            data: [{
                menu: "\u9009\u9879\u4e00",
                images: '<img src="resources/img/bmw.gif" height="72" width="72">'
            }, {
                menu: "\u9009\u9879\u4e8c",
                images: '<img src="resources/img/bmw.gif" height="72" width="72">'
            }, {
                menu: "\u9009\u9879\u4e09",
                images: '<img src="resources/img/bmw.gif" height="72" width="72">'
            }, {
                menu: "\u9009\u9879\u56db",
                images: '<img src="resources/img/bmw.gif" height="72" width="72">'
            }, {
                menu: "\u9009\u9879\u4e94",
                images: '<img src="resources/img/bmw.gif" height="72" width="72">'
            }, {
                menu: "\u9009\u9879\u516d",
                images: '<img src="resources/img/bmw.gif" height="72" width="72">'
            }],
            autoLoad: !0
        }));
        console.log(">> Home_DATA_VIEW [created]");
        this.callParent(arguments)
    }
});
Ext.define("App.view.Infos", {
    extend: "Ext.dataview.NestedList",
    xtype: "infolist",
    id: "infolist",
    requires: ["App.store.Infos"],
    config: {
        title: "\u5173\u4e8e",
        ui: "light",
        useTitleAsBackText: !1,
        onItemDisclosure: !0,
        store: "Infos",
        zIndex: 0,
        backText: "\u8fd4\u56de"
    },
    getTitleTextTpl: function(){
        return "<div>{name}</div>"
    },
    getItemTextTpl: function(){
        return "<div><strong>{name}</strong></div>"
    }
});
Ext.define("App.view.List", {
    extend: "Ext.dataview.NestedList",
    requires: ["Ext.dataview.List", "App.store.States", "App.model.States"],
    id: "citylist",
    xtype: "citylist",
    config: {
        title: "ceshi",
        store: "States",
        zIndex: 0,
        useTitleAsBackText: !1,
        onItemDisclosure: !0,
        disclosure: !0
    },
    getTitleTextTpl: function(){
        return "<div>{state}</div>"
    },
    getItemTextTpl: function(){
        return "<div><em>{state}</em></div>"
    }
});
Ext.define("App.view.Morelist", {
    extend: "Ext.dataview.List",
    requires: ["App.store.Mores", "App.model.More", "App.view.Hoslist.List"],
    xtype: "morelist",
    id: "morelist",
    config: {
        disclosure: !0,
        cls: "list2",
        itemCls: "list2_item",
        emptyText: "\u8bf7\u5148\u786e\u4fdd\u662f\u5426\u6709\u7f51\u7edc\uff0c\u518d\u5237\u65b0",
        ui: "round",
        scroll: !1,
        items: [{
            xtype: "titlebar",
            title: "\u8bbe\u7f6e",
            items: {
                xtype: "button",
                id: "moresettingbackbutton",
                ui: "back",
                text: "\u8fd4\u56de"
            }
        }],
        itemTpl: '<tpl if="needsIcon"><img width="18" height="18" src="resources/img/{icon}.png" align="absmiddle" /></tpl>{name}'
    },
    initialize: function(){
        this.setStore(Ext.create("Ext.data.Store", {
            requires: "App.model.More",
            model: "App.model.More",
            data: [{
                name: "\u95ee\u9898\u53cd\u9988",
                icon: "question",
                needsIcon: !0
            }, {
                name: "\u627e\u56de\u5bc6\u7801",
                icon: "password",
                needsIcon: !0
            }, {
                name: "\u5e2e\u52a9\u6559\u7a0b",
                icon: "sound",
                needsIcon: !0
            }, {
                name: "\u5173\u4e8e\u5e94\u7528",
                icon: "version",
                needsIcon: !1
            }, {
                name: "\u76f4\u63a5\u767b\u5f55",
                icon: "login",
                needsIcon: !0
            }, {
                name: "\u5ba2\u670d\u7535\u8bdd",
                icon: "phone",
                needsIcon: !0
            }, {
                name: "\u8f6f\u4ef6\u7248\u672c1.1",
                icon: "version",
                needsIcon: !0
            }],
            autoLoad: !0
        }));
        console.log(">> MoreLIST_VIEW [created]");
        this.callParent(arguments)
    }
});
Ext.define("App.view.settings", {
    extend: "Ext.form.Panel",
    alias: "widget.settings",
    id: "settings",
    config: {
        items: [{
            docked: "top",
            xtype: "titlebar",
            title: "\u610f\u89c1\u63d0\u4ea4",
            id: "settingtoolbar",
            ui: "light",
            items: [{
                id: "settingbackbutton",
                xtype: "button",
                ui: "back",
                text: "\u8fd4\u56de"
            }]
        }, {
            xtype: "fieldset",
            defaults: {
                required: !0,
                labelAlign: "left",
                labelWidth: "35%"
            },
            items: [{
                xtype: "textfield",
                name: "name",
                placeHolder: "\u4f8b\u5982\u540d\u79f0,\u6982\u8981\u7b49\u7b49",
                label: "\u4e3b\u9898"
            }, {
                xtype: "textareafield",
                name: "password",
                placeHolder: "\u8bf7\u8f93\u5165\u8be6\u7ec6\u7684\u5185\u5bb9\u4ee5\u53ca\u8054\u7cfb\u65b9\u5f0f",
                label: "\u5185\u5bb9"
            }]
        }, {
            xtype: "panel",
            layout: "hbox",
            height: 40,
            items: [{
                xtype: "button",
                text: "\u63d0\u4ea4",
                ui: "action",
                id: "btnSubmit",
                flex: 1
            }, {
                xtype: "button",
                text: "\u91cd\u7f6e",
                ui: "decline",
                flex: 1,
                id: "btnReset",
                style: "margin-left:3px;"
            }]
        }, {
            xtype: "fieldset",
            instructions: "Copyright reserved by \u714e\u86cb\u5de5\u4f5c\u5ba4<br/>Version:1.1.0"
        }]
    }
});
Ext.define("App.view.Hoslist.CityTabPanel", {
    extend: "Ext.tab.Panel",
    requires: ["App.view.legislator.Bio", "App.view.bill.List", "App.view.vote.List"],
    id: "HosTabPanel",
    xtype: "HosTabPanel",
    config: {
        tabBar: {
            ui: "gray"
        },
        items: [{
            id: "legislatorToolbar",
            docked: "top",
            xtype: "toolbar",
            ui: "light",
            items: [{
                xtype: "button",
                text: "\u8fd4\u56de",
                ui: "back",
                id: "CityBackbutton"
            }]
        }, {
            title: "\u533b\u9662\u7b80\u4ecb",
            xclass: "App.view.legislator.Bio"
        }, {
            title: "\u91cd\u70b9\u79d1\u5ba4",
            xclass: "App.view.bill.List"
        }, {
            title: "\u533b\u751f\u63a8\u8350",
            xclass: "App.view.vote.List"
        }]
    }
});
Ext.define("App.view.search.SearchPanel", {
    extend: "Ext.Panel",
    requires: ["App.view.search.SearchList", "App.view.HomeCard", "App.view.search.SearchDetail", "App.view.Detail"],
    id: "SearchPanel",
    xtype: "SearchPanel",
    config: {
        layout: {
            type: "card"
        },
        items: [{
            xtype: "toolbar",
            docked: "top",
            ui: "light",
            items: [{
                id: "searchpanelbackbutton",
                xtype: "button",
                ui: "back",
                text: "\u8fd4\u56de"
            }, {
                xtype: "searchfield",
                id: "searchfieltext",
                placeHolder: "\u8f93\u5165\u75be\u75c5\u67e5\u627e...",
                centerd: !0,
                listeners: {}
            }]
        }, {
            xtype: "searchList"
        }, {
            xtype: "SearchDetail"
        }]
    }
});
Ext.define("App.view.ListPanel", {
    extend: "Ext.Container",
    id: "ListPanel",
    xtype: "ListPanel",
    requires: ["App.view.Hoslist.List", "App.view.Hoslist.detail", "App.view.Hoslist.Bio"],
    config: {
        layout: {
            type: "card"
        },
        items: [{
            id: "ListPanelToolbar",
            docked: "top",
            xtype: "toolbar",
            ui: "light",
            title: "\u9009\u62e9\u7701\u5e02",
            items: {
                xtype: "button",
                text: "\u8fd4\u56de",
                ui: "back",
                id: "CityBackbutton2"
            }
        }, {
            xclass: "App.view.Hoslist.List"
        }, {
            xclass: "App.view.Hoslist.detail"
        }, {
            xclass: "App.view.Hoslist.Bio"
        }]
    },
    animateTo: function(){
    }
});



Ext.define("App.controller.Main", {
    extend: "Ext.app.Controller",
    requires: ["App.view.Detail", "Ext.MessageBox", "App.view.Hoslist.Bio"],
    config: {
        refs: {
            mainView: "#mainview",
            mainList: "#mainlist",
            hosList: "#HosList",
            hosDetail: "#HosDetail",
            listPanel: "#ListPanel",
            citybackButton: "#CityBackbutton",
            billList: "#billList",
            voteList: "#voteList",
            searchbutton: "#searchbutton",
            submitForm: "settings",
            homeCard: "homeCard",
            homePage: "homepage",
            moreList: "morelist",
            searchList: "searchList"
        },
        routes: {
            ":id": "showViewById",
            "section/:id": "showSectionById",
            "section/:id/:product": "showSectionById"
        },
        control: {
            mainView: {
                activeitemchange: "onMainViewActiveItemChange"
            },
            mainList: {
                activeitemchange: "onListActiveItemChange"
            },
            "#hosbutton": {
                tap: "OnhosButtonTap"
            },
            "#seabutton": {
                tap: "OnSeaButtonTap"
            },
            "#sugbutton": {
                tap: "OnSubButtonTap"
            },
            "#helpbutton": {
                tap: "OnHelpButtonTap"
            },
            "#abobutton": {
                tap: "OnAboButtonTap"
            },
            homepage: {
                itemtap: "OnHomepageTap"
            },
            hosDetail: {
                itemtap: "OnCityDetailTap"
            },
            hosList: {
                itemtap: "onCityListTap"
            },
            billList: {
                activate: "onBillListActivate",
                itemtap: "onBillTap"
            },
            "#btnSubmit": {
                tap: "OnBtnSubTap"
            },
            "#btnReset": {
                tap: "OnBtnResetTap"
            },
            voteList: {
                activate: "onVoteListActivate"
            },
            "#CityBackbutton": {
                tap: function(){
                    Ext.getCmp("ListPanel").setActiveItem(1);
                    Ext.getCmp("ListPanelToolbar").show()
                }
            },
            "#CityBackbutton2": {
                tap: function(){
                    "HosDetail" == Ext.getCmp("ListPanel").getActiveItem().getItemId() ? Ext.getCmp("ListPanel").setActiveItem(0) : this.redirectTo("home")
                }
            },
            "#billSummaryBackButton": {
                tap: function(){
                    Ext.getCmp("ListPanel").setActiveItem(0)
                }
            },
            "#settingbackbutton": {
                tap: function(){
                    this.redirectTo("settingup")
                }
            },
            "#fogotpwdbackbutton": {
                tap: function(){
                    this.redirectTo("settingup")
                }
            },
            "#loginbackbutton": {
                tap: function(){
                    this.redirectTo("settingup")
                }
            },
            "#helptextbackbutton": {
                tap: function(){
                    this.redirectTo("settingup")
                }
            },
            "#phonebackbutton": {
                tap: function(){
                    this.redirectTo("settingup")
                }
            },
            searchbutton: {
                tap: "OnSearchButtonTap"
            },
            homeCard: {
                selectindexcommand: "OnselectindexcommandTap"
            },
            moreList: {
                itemtap: "OnMoreListTap"
            },
            "#searchbutton": {
                tap: "OnsearchbuttonTap"
            },
            "#searchfieltext": {
                keyup: "onSearch",
                clearicontap: "onSearchClearIconTap"
            },
            "#searchpanelbackbutton": {
                tap: "OnsearchpanelbackbuttonTap"
            },
            "#searchList": {
                itemtap: "OnSearchListTap"
            },
            "#moresettingbackbutton": {
                tap: function(){
                    this.redirectTo("home")
                }
            }
        },
        history: null
    },
    init: function(){
        this.setHistory(this.getApplication().getHistory())
    },
    launch: function(){
        Ext.get("divpanel").onclick = function(){
            alert("1")
        }
    },
    OnsearchpanelbackbuttonTap: function(){
        var a = Ext.getCmp("SearchPanel");
        console.log(a.getActiveItem().getItemId());
        "searchList" == a.getActiveItem().getItemId() ? this.redirectTo("home") : Ext.getCmp("SearchPanel").setActiveItem(0)
    },
    OnSearchListTap: function(a, b, d, c){
        Ext.getCmp("SearchDetail").setData(c.data);
        Ext.getCmp("SearchPanel").setActiveItem(2)
    },
    onSearch: function(a){
        var b = a.getValue(), a = Ext.getStore("Diseases");
        console.log(a);
        a.clearFilter();
        if (b) {
            var b = b.split(" "), d = [], c;
            for (c = 0; c < b.length; c++) 
                b[c] && d.push(RegExp(b[c], "i"));
            a.filter(function(a){
                var b = [];
                for (c = 0; c < d.length; c++) {
                    var f = d[c], f = a.get("sickness").match(f) || a.get("memo").match(f);
                    b.push(f)
                }
                return 1 < d.length && -1 != b.indexOf(!1) ? !1 : b[0]
            })
        }
    },
    onSearchClearIconTap: function(){
        Ext.getStore("Diseases").clearFilter()
    },
    OnMoreListTap: function(a, b, d, c){
        a = c.getData().name;
        "\u95ee\u9898\u53cd\u9988" == a ? Ext.getCmp("mainview").setActiveItem(5) : "\u627e\u56de\u5bc6\u7801" == a ? Ext.getCmp("mainview").setActiveItem(6) : "\u5e2e\u52a9\u6559\u7a0b" == a ? Ext.getCmp("mainview").setActiveItem(7) : "\u76f4\u63a5\u767b\u5f55" == a ? Ext.getCmp("mainview").setActiveItem(8) : "\u5ba2\u670d\u7535\u8bdd" == a && Ext.getCmp("mainview").setActiveItem(9)
    },
    OnsearchbuttonTap: function(){
        Ext.getCmp("SearchPanel").setActiveItem(1)
    },
    OnHomepageTap: function(a, b, d, c, e){
        e.getTarget("img");
        a = c.getData().menu;
        "\u9009\u9879\u4e00" == a ? this.redirectTo("search") : "\u9009\u9879\u4e8c" == a ? this.redirectTo("download") : "\u9009\u9879\u4e09" == a ? this.redirectTo("settings") : "\u9009\u9879\u56db" == a ? this.redirectTo("info") : "\u9009\u9879\u4e94" == a ? this.redirectTo("info") : "\u9009\u9879\u516d" == a && this.redirectTo("info")
    },
    OnhosButtonTap: function(){
        this.redirectTo("download")
    },
    OnSeaButtonTap: function(){
        this.redirectTo("search")
    },
    OnSubButtonTap: function(){
        this.redirectTo("settings")
    },
    OnHelpButtonTap: function(){
        this.redirectTo("info")
    },
    OnAboButtonTap: function(){
        this.redirectTo("info")
    },
    OnSearchButtonTap: function(){
    },
    OnBtnResetTap: function(){
        this.getSubmitForm().reset()
    },
    OnBtnSubTap: function(){
        var a = this, b = this.getSubmitForm().getValues();
        this.getSubmitForm().setMasked({
            xtype: "loadmask",
            message: "\u63d0\u4ea4\u4e2d..."
        });
        Ext.data.JsonP.request({
            timeout: 3E4,
            disableCaching: !0,
            url: "http://www.jdtouch.net/Submit.ashx",
            callbackName: "callback",
            params: b,
            failure: function(b){
                a.getSubmitForm().unmask();
                Ext.Msg.alert("Error", b)
            },
            success: function(b){
                console.log(b);
                a.getSubmitForm().unmask();
                1 == b.s ? (a.getSubmitForm().reset(), Ext.Msg.alert("\u63d0\u4ea4\u6210\u529f\uff01\u611f\u8c22\u60a8\u7684\u652f\u6301!"), a.redirectTo("settings")) : 0 == b.s && Ext.Msg.alert(b.m)
            }
        })
    },
    addToHistory: function(a){
        this.getHistory().add(new Ext.app.Action({
            url: a
        }), !0)
    },
    onBillListActivate: function(){
        var a = this.currentLegislator.OfficeID, b = Ext.getStore("Bills");
        b.setProxy({
            type: "jsonp",
            url: "http://www.jdtouch.net/office.ashx?OfficeID=" +
            a +
            "",
            callbackName: "callback",
            reader: {
                type: "json",
                rootProperty: "response.offices",
                record: "office"
            }
        });
        b.load();
        Ext.getCmp("billList").setData(b.getData())
    },
    onBillTap: function(){
    },
    onVoteListActivate: function(){
        var a = Ext.getStore("Votes");
        a.setProxy({
            type: "jsonp",
            url: "http://www.jdtouch.net/Doctor.ashx?doctorid=" + this.currentLegislator.DoctorsID + "",
            callbackName: "callback",
            reader: {
                type: "json",
                rootProperty: "response.doctors",
                record: "doctor"
            }
        });
        a.load();
        var b = Ext.getCmp("voteList");
        console.log(a);
        b ? Ext.getCmp("voteList").setData(a.getData()) : (alert("2"), Ext.getCmp("voteList").setData(a.getData()), a.removeAll())
    },
    onCityListTap: function(a, b, d, c){
        store = Ext.getStore("Legislators");
        store.removeAll();
        store.setProxy({
            type: "jsonp",
            url: "http://www.jdtouch.net/Test.ashx?title=" + c.data.abbr + "",
            callbackName: "callback",
            reader: {
                type: "json",
                rootProperty: "response.hospitals",
                record: "hospital"
            }
        });
        store.load();
        this.getListPanel().setActiveItem(1)
    },
    OnCityDetailTap: function(a, b, d, c){
        this.currentLegislator == c.data ? Ext.getCmp("ListPanel").setActiveItem(3) : (this.currentLegislator = c.data, Ext.getCmp("HosTabPanel") ? (Ext.getCmp("legislatorBio").setData(c.data), Ext.getCmp("ListPanelToolbar").setTitle(this.currentLegislator.abbr), Ext.getCmp("ListPanel").setActiveItem(3)) : Ext.getCmp("ListPanel").setActiveItem({
            xclass: "App.view.Hoslist.CityTabPanel"
        }), Ext.getCmp("HoslistBio"), Ext.getCmp("legislatorBio").setData(this.currentLegislator), Ext.getCmp("legislatorToolbar").setTitle(this.currentLegislator.Abbr), Ext.getCmp("ListPanelToolbar").hide(), Ext.getCmp("HosTabPanel").setActiveItem(0))
    },
    onDetailCardActivate: function(a, b){
        var d = b.getLastNode();
        a.down("#description").setHtml(d.get("description"));
        var c = a.down("#productBtn");
        c.setText(d.get("name"));
        c.on({
            scope: d,
            tap: this.onDetailButtonTap
        })
    },
    onDetailButtonTap: function(){
        Ext.Msg.alert(this.get("name"), this.get("description"), Ext.emptyFn)
    },
    onMainViewActiveItemChange: function(a, b, d){
        Ext.isDefined(d) &&
        (a = b.getId(), "sections" === a ? (a = this.getMainList().getLastNode(), a.isRoot() ? this.addToHistory("sections") : this.addToHistory("section" + a.getPath("id").slice(5))) : this.addToHistory(a))
    },
    onListActiveItemChange: function(a, b, d){
        "detailcard" == b.getId() && Ext.isObject(d) ? (b = d.getStore().getNode(), a = a.getLastNode(), this.addToHistory("section/" + b.get("id") + "/" + a.get("id"))) : (b = b.getStore().getNode(), "root" === b.get("id") ? this.addToHistory("sections") : this.addToHistory("section/" + b.get("id")))
    },
    showViewById: function(a){
        var b = this.getMainView();
        Ext.each(b.getInnerItems(), function(d){
            d.getId() == a && b.setActiveItem(d)
        })
    },
    goToSelectedNode: function(a, b, d, c){
        if (d = b.getNodeById(d)) 
            a.goToNode(d), Ext.isDefined(c) && (b = b.getNodeById(c)) && a.goToLeaf(b)
    },
    showSectionById: function(a, b){
        this.showViewById("sections");
        var d = this, c = this.getMainList(), e = c.getStore();
        if (e.loading) 
            e.on({
                load: function(){
                    d.goToSelectedNode(c, e, a, b)
                }
            });
        else 
            d.goToSelectedNode(c, e, a, b)
    }
});
Ext.application({
    name: "App",
    requires: ["Ext.MessageBox"],
    views: "Main,App.view.HomeCard,Homepage,App.view.Hoslist.CityTabPanel,App.view.ListPanel,App.view.Hoslist.Bio,App.view.Hoslist.detail,App.view.Hoslist.List,App.view.Infos,App.view.settings,App.view.search.SearchPanel,App.view.Morelist".split(","),
    models: "Sections,States,Legislator,Bill,Vote,Info,Home,More,Disease".split(","),
    stores: "Sections,States,Legislators,Bills,Votes,Infos,Homes,Mores,Diseases".split(","),
    controllers: ["Main"],
    icon: {
        57: "resources/icons/Icon.png",
        72: "resources/icons/Icon~ipad.png",
        114: "resources/icons/Icon@2x.png",
        144: "resources/icons/Icon~ipad@2x.png"
    },
    phoneStartupScreen: "resources/loading/Homescreen.jpg",
    tabletStartupScreen: "resources/loading/Homescreen~ipad.jpg",
    launch: function(){
        winWidth = Ext.getBody().getWidth();
        winHeight = Ext.getBody().getHeight();
        Ext.fly("appLoadingIndicator").destroy();
        Ext.Viewport.add(Ext.create("App.view.Main"))
    },
    onUpdated: function(){
        Ext.Msg.confirm("\u7a0b\u5e8f\u66f4\u65b0", "\u6b64\u5e94\u7528\u7a0b\u5e8f\u6709\u6700\u65b0\u66f4\u65b0. \u73b0\u5728\u4e0b\u8f7d\u66f4\u65b0?", function(a){
            "yes" === a && window.location.reload()
        })
    }
});
